package chapter02

import scala.collection.mutable
import scala.util.Random

object Test24_Set2 {
  def main(args: Array[String]): Unit = {
    //数据去重
    val list = List("张三","李四","王五","张三","李四","田七","李四","王五")
    val new_list = mutable.ListBuffer[String]()
    for(i<-list){
      if(!new_list.contains(i)){
        new_list.append(i)
      }
    }
    println(new_list)
    //可以转化为set去重复
    println(list.toSet.toList)
    println(Random.nextInt(35))
  }
}
